package dao;
import bean.DBHelper;
import bean.Student;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;

public class ScoreDao {
	public String getStudentScore(String sno){
		String score = null;
		String sql="select score from score where sno="+sno;
		ResultSet rs=DBHelper.executeQuery(sql);
		try{
			while(rs.next()){
				score=rs.getString(1);
			}
		}catch(Exception ex){
			ex.printStackTrace();
		}
		DBHelper.close();
		return score;
	}
	public void addStudentScore(int grade,String sno){
		String sql="update student set score="+String.valueOf(grade)+" where sno="+"'"+sno+"'";
		DBHelper.executeUpdate(sql);
		DBHelper.close();
	}
	
}
